package code08_三大特征.test10_多态;

public class Test {
	public static void main(String[] args) {
		Master master = new Master("汤小洋");
		
		Dog dog = new Dog("旺财", "公", "游戏");
		master.play(dog); // 将子类的对象作为方法的实参
		Bone bone = new Bone();
		bone.name="骨头";
		master.feed(dog, bone);
		
		System.out.println("------------------------------");
		
		Cat cat = new Cat("猫咪", "母", "波斯猫");
		master.play(cat);
		Fish fish = new Fish();
		fish.name = "鱼";
		master.feed(cat, fish);
	}
}


